<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>

<script>
    let sunct = prompt("请输入学生数:");
    sunct = parseInt(sunct)
    if (sunct === null || sunct === '') {
        console.log("没有学生");
    } else {
        let tts = 0;
        for (let i = 0; i < sunct; i++) {
            let score = prompt("请输入第" +(i + 1)+ "个学生的成绩:");
            tts += score;
        }
        let ags = tts / sunct;
        console.log("总成绩:"+ tts +",平均成绩:" + ags.toFixed(1));
    }

</script>

